import { CellRenderer } from "../../../../../fl/controls/listClasses/CellRenderer";
import { GlobalClass } from "../../../../../com/mui/core/GlobalClass";
import { ResouceConst } from "../../../../component/gconst/ResouceConst";
import { ObjCreate } from "../../common/ObjCreate";
import { GlobalStyle } from "../../../../common/global/GlobalStyle";
import { SMarryHistory } from "../../../../../Message/Game/SMarryHistory";
import { DateParser } from "../../../../common/tools/DateParser";
//class MarryLogCell
    
    export  class MarryLogCell extends CellRenderer
    {
        constructor()
        {
            super();
            this.initStyles();
            this.create();
            return;
        }

        /* internal  */initStyles(): void
        {
            this.setStyle("downSkin", GlobalClass.getBitmap("Friend_over"));
            this.setStyle("overSkin", GlobalClass.getBitmap("Friend_over"));
            this.setStyle("upSkin", new Object /* flash.display.Bitmap */());
            this.setStyle("selectedDownSkin", GlobalClass.getBitmap("Friend_over"));
            this.setStyle("selectedOverSkin", GlobalClass.getBitmap("Friend_over"));
            this.setStyle("selectedUpSkin", GlobalClass.getBitmap("Friend_over"));
            return;
        }

        /* internal  */create(): void
        {
            this._bmpLine = ResouceConst.getScaleBitmap("SplitLine");
            this._bmpLine.width = 510;
            this._bmpLine.height = 2;
            this.addChild(this._bmpLine);
            this._tfDate = ObjCreate.createTextField("", 5, 8, 120, 20, this);
            this._tfDes = ObjCreate.createTextField("", 125, 8, 390, 20, this, GlobalStyle.textFormat2);
            return;
        }

        public /* override */ set label(arg1: string)
        {
            return;
        }

        public /* override */ set data(arg1: Object)
        {
            if (typeof arg1 === "smarryhistory") 
            {
                this._marryHistory = arg1 as SMarryHistory;
            }
            this.updateView();
            return;
        }

        /* internal  */updateView(): void
        {
            this._tfDate.text = DateParser.parse(this._marryHistory.createDt, "yyyy-MM-dd hh: mm");
            this._tfDes.text = this._marryHistory.content;
            return;
        }

        /* internal */ /* var */_bmpLine: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_tfDate: Object /* flash.text.TextField */;

        /* internal */ /* var */_tfDes: Object /* flash.text.TextField */;

        /* internal */ /* var */_marryHistory: SMarryHistory;
    }
